Skip to content

test(frontend): extend WorkflowCompilingService, ListItemComponent, and DownloadService coverage#6557

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
mengw15:chore/6552-three-spec-coverage
Jul 20, 2026
Merged

test(frontend): extend WorkflowCompilingService, ListItemComponent, and DownloadService coverage#6557
aglinxinyuan merged 1 commit into
apache:mainfrom
mengw15:chore/6552-three-spec-coverage

Conversation

@mengw15

@mengw15 mengw15 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends three existing frontend specs to cover previously untested methods
(all Vitest; no production code changed).

WorkflowCompilingService (+9 tests) — getWorkflowCompilationState,
getWorkflowCompilationErrors (empty while succeeded/uninitialized, surfaces
operator errors when failed), getCompilationStateInfoChangedStream (replays
the latest state), getOperatorOutputSchemaMap, getPortInputSchema, and
getOperatorInputAttributeType. The private compilation-state snapshot is set
directly and the port-lookup delegates are spied so each getter's own logic is
exercised.

ListItemComponent (+8 tests) — onEditName, onEditDescription (opens the
edit modal and applies / closes the change; no-op when not editable),
onCheckboxChange, toggleLike (like / unlike success paths + the no-user
guard), and openDetailModal (opens the modal and bumps the view count).
NzModalService and HubService are spied.

DownloadService (+3 tests) — exportWorkflowResultToDataset (POST body /
headers, plus the kubernetes ?cuid= URL branch, via HttpTestingController)
and exportWorkflowResultToLocal (builds and submits the hidden form carrying
the request + token, then cleans up). The download form's submit and the
cleanup setTimeout are stubbed so no real navigation or leaked timer occurs.

Any related issues, documentation, discussions?

Closes #6552

How was this PR tested?

Extended unit tests, run locally in frontend/ (all green; each spec's failure
path was verified by breaking a new assertion to confirm it goes red):

ng test --watch=false --include src/app/workspace/service/compile-workflow/workflow-compiling.service.spec.ts   # 16 passed
ng test --watch=false --include src/app/dashboard/component/user/list-item/list-item.component.spec.ts           # 20 passed
ng test --watch=false --include src/app/dashboard/service/user/download/download.service.spec.ts                 # 17 passed (1 pre-existing skip)
prettier --write <specs>   # clean
eslint  <specs>            # clean

All collaborators are stubbed, so the suite makes no network calls, opens no
real modal, and triggers no real download (see frontend/TESTING.md).

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @kunwp1, @aglinxinyuan
    You can notify them by mentioning @kunwp1, @aglinxinyuan in a comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends frontend unit test coverage (Vitest) for three existing units—WorkflowCompilingService, ListItemComponent, and DownloadService—to cover previously untested public methods/handlers, without changing production code.

Changes:

  • Added tests for WorkflowCompilingService public getters, including compilation-state/error getters and schema lookup helpers.
  • Added tests for ListItemComponent interaction handlers (edit name/description, checkbox toggle, like/unlike, detail modal open).
  • Added tests for DownloadService export methods, including request construction/URL branching and DOM-form based local export behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/src/app/workspace/service/compile-workflow/workflow-compiling.service.spec.ts Adds unit tests covering WorkflowCompilingService getter logic and compilation-state stream behavior.
frontend/src/app/dashboard/component/user/list-item/list-item.component.spec.ts Adds unit tests for ListItemComponent edit and interaction handlers (modal, like/unlike, checkbox, view count).
frontend/src/app/dashboard/service/user/download/download.service.spec.ts Adds unit tests for dataset/local export behaviors, including HTTP request validation and hidden-form submission flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

codecov-commenter commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.68%. Comparing base (80c45be) to head (0a06bae).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6557      +/-   ##
============================================
+ Coverage     72.54%   72.68%   +0.13%     
  Complexity     3436     3436              
============================================
  Files          1145     1145              
  Lines         45129    45129              
  Branches       4975     4975              
============================================
+ Hits          32738    32800      +62     
+ Misses        10709    10631      -78     
- Partials       1682     1698      +16     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 80c45be
agent-service 76.76% <ø> (ø) Carriedforward from 80c45be
amber 66.81% <ø> (ø) Carriedforward from 80c45be
computing-unit-managing-service 17.72% <ø> (ø) Carriedforward from 80c45be
config-service 66.66% <ø> (ø) Carriedforward from 80c45be
file-service 66.80% <ø> (ø) Carriedforward from 80c45be
frontend 74.13% <ø> (+0.33%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 80c45be
pyamber 91.79% <ø> (ø) Carriedforward from 80c45be
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 80c45be

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mengw15
mengw15 force-pushed the chore/6552-three-spec-coverage branch from efec911 to 0a06bae Compare July 19, 2026 08:13
@mengw15
mengw15 requested a review from aglinxinyuan July 19, 2026 08:22

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 20, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 20, 2026
Merged via the queue into apache:main with commit aa5a20b Jul 20, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add unit test coverage for WorkflowCompilingService, ListItemComponent, and DownloadService

4 participants